import {resolve} from 'path'

import react from "@vitejs/plugin-react-swc";
import { ConfigEnv, defineConfig } from "vite";

// https://vitejs.dev/config/
export default defineConfig(({ command, mode, isSsrBuild, isPreview }: ConfigEnv) => {
  console.log(command, mode, isSsrBuild, isPreview);
  return {
    base: mode === "development" ? "./" : "./",
    server: {
      host: "0.0.0.0",
      port: 3000,
      cors: true,
    },
    resolve: {
      alias: {
        "@": resolve(__dirname, "./src"),
      },
    },
    css: {
 /*      preprocessorOptions: {
        scss: {
          defineConfig: {
            additionalData: `@import "@/styles/variable.scss";`,
          },
        },
      }, */
    },
    plugins: [react()],
    build: {},
  };
});
